package com.demo.component;

import com.demo.model.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
public class StudentBeans {

//    @Scope("prototype")
    @Bean
    public Student student1(){
        Student stu=new Student();
        stu.setId(1);
        stu.setName("张三");
        return stu;
    }

    @Bean
    public Student student2(){
        Student stu=new Student();
        stu.setId(2);
        stu.setName("lisi");
        return stu;
    }
}
